﻿using System;
using System.Collections.Concurrent;

namespace Listing1_33
{
    public static class Program
    {
        public static void Main()
        {
            ConcurrentQueue<int> queue = new ConcurrentQueue<int>();
            queue.Enqueue(42);
            queue.Enqueue(24);
            int result;
            if (queue.TryDequeue(out result))
                Console.WriteLine("Dequeued: {0}", result);
            Console.ReadKey();
        }
    }
}